<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="UsuarioCreateDlg" widgetVar="UsuarioCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{appBundle.CreateUsuarioTitle}" closeOnEscape="true">

            <h:form id="UsuarioCreateForm">

                <h:panelGroup id="display" rendered="#{usuarioController.selected != null}">
                    <p:panelGrid columns="2" columnClasses="column">

                        <p:outputLabel value="#{appBundle.CreateUsuarioLabel_usId}" for="usId" />
                        <p:inputText id="usId" value="#{usuarioController.selected.usId}" title="#{appBundle.CreateUsuarioTitle_usId}" required="true" requiredMessage="#{appBundle.CreateUsuarioRequiredMessage_usId}" size="20" maxlength="20"/>

                        <p:outputLabel value="#{appBundle.CreateUsuarioLabel_usApellidos}" for="usApellidos" />
                        <p:inputText id="usApellidos" value="#{usuarioController.selected.usApellidos}" title="#{appBundle.CreateUsuarioTitle_usApellidos}" size="70" maxlength="70"/>

                        <p:outputLabel value="#{appBundle.CreateUsuarioLabel_usNombre}" for="usNombre" />
                        <p:inputText id="usNombre" value="#{usuarioController.selected.usNombre}" title="#{appBundle.CreateUsuarioTitle_usNombre}" size="70" maxlength="70"/>

                        <p:outputLabel value="#{appBundle.CreateUsuarioLabel_usClave}" for="usClave" />
                        <p:inputText id="usClave" value="#{usuarioController.selected.usClave}" title="#{appBundle.CreateUsuarioTitle_usClave}" size="30" maxlength="30"/>
                    </p:panelGrid>
                    <p:commandButton action="#{contenidoController.actualizarUsuario()}" actionListener="#{usuarioController.saveNew}" value="#{appBundle.Save}" update="display,:UsuarioListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,UsuarioCreateDialog);">
                        <p:confirm header="#{appBundle.ConfirmationHeader}" message="#{appBundle.ConfirmCreateMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>

                    <p:commandButton value="#{appBundle.Cancel}" onclick="UsuarioCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
